from sqlalchemy import create_engine, Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker

Base = declarative_base()


class Personal(Base):
    __tablename__ = 'PERSONAL'

    id = Column(String(100), primary_key=True)
    username = Column(String(50), unique=True)
    age = Column(Integer)

def main():
    engine = create_engine('dm://SYSDBA:SYSDBA@localhost:5236', connect_args={'autoCommit': False})
    Base.metadata.create_all(engine, checkfirst=True)

    session = sessionmaker(bind=engine)()

    new_user = Personal(id='1', username='user1', age=25)
    session.add(new_user)

    personal = session.query(Personal).filter_by(username='user1').first()
    print(personal.username)

if __name__ == '__main__':
    main()
